package CreateThread;

class MyRunning implements Runnable{
    @Override
    public void run() {
        System.out.println("hello world");
    }
}
public class Method2 {
    public static void main(String[] args) {
        //这只是描述了一个任务(描述了要干啥:run())
        Runnable runnable = new MyRunning();
        //把任务交给线程执行
        Thread t = new Thread(runnable);
        t.start();
    }
}